﻿CREATE TABLE [PR].[PriceLinesNOTParsed] (
    [Id]                 INT             IDENTITY (1, 1) NOT NULL,
    [ContragentId]       INT             NOT NULL,
    [GoodsCode]          INT             NOT NULL,
    [GoodsName]          VARCHAR (150)   NOT NULL,
    [CountryName]        VARCHAR (20)    NULL,
    [ManufacturerName]   VARCHAR (70)    NULL,
    [Price]              DECIMAL (19, 2) NOT NULL,
    [Qntty]              INT             NOT NULL,
    [NDSTax]             TINYINT         NULL,
    [BatchNumber]        VARCHAR (20)    NULL,
    [ReadyBefore]        SMALLDATETIME   NULL,
    [ReestrPrice]        DECIMAL (19, 2) NULL,
    [ReestrDate]         SMALLDATETIME   NULL,
    [Mandatory]          BIT             CONSTRAINT [DF__PriceLine__Manda__36BC0F3B] DEFAULT ((0)) NULL,
    [Drastic]            BIT             CONSTRAINT [DF__PriceLine__Drast__37B03374] DEFAULT ((0)) NULL,
    [RetailPack]         INT             CONSTRAINT [DF__PriceLine__Retai__38A457AD] DEFAULT ((1)) NULL,
    [ManufactureBarCode] VARCHAR (13)    NULL,
    [GNVLS]              BIT             CONSTRAINT [DF_PriceLinesNOTParsed_GNVLS] DEFAULT ((0)) NULL,
    [Note]               VARCHAR (250)   NULL,
    CONSTRAINT [PK_PriceLinesNOTParsed] PRIMARY KEY NONCLUSTERED ([Id] ASC),
    CONSTRAINT [FK_PriceLinesNOTParsed_Contragents] FOREIGN KEY ([ContragentId]) REFERENCES [CA].[Contragents] ([Id]) ON DELETE CASCADE NOT FOR REPLICATION
);


GO
CREATE NONCLUSTERED INDEX [IX_PriceLinesNOTParsed_ContragentId]
    ON [PR].[PriceLinesNOTParsed]([ContragentId] ASC);

